import { req3 } from "@/api/req";
import constant from "@/public/constant";

let api = {
  //查询供应商可融金额
  getAvailableAmount: (data) =>
    req3({
      baseUrl: "srm",
      method: "get",
      url: "tblAccountbill/queryTblAccountbillMoney",
      params: data,
    }),
  //分页查询融资历史记录
  getApplyHistoy: (data) =>
    req3({
      baseUrl: "fin",
      method: "post",
      url: "tblFinSrmApplyInfo/getHistoryPagelist",
      params: data,
    }),
  //获取天进宝利率
  getCustomerRate: (data) =>
    req3({
      baseUrl: "fin",
      method: "get",
      url: "tblFinSrmRate/getFinSRate",
      params: data,
    }),
  //查询客户累计未还款总金额
  getAllRepayment: (data) =>
    req3({
      baseUrl: "fin",
      method: "get",
      url: "tblFinSrmApplyInfo/getAllApplyAmt",
      params: data,
    }),
  //确认天进宝申请
  confirmApply: (data) =>
    req3({
      baseUrl: "fin",
      method: "post",
      url: "tblFinSrmApplyInfo/confirmApply",
      params: data,
    }),
  //获取关联对账函列表
  getApplyLetter: (data) =>
    req3({
      baseUrl: "fin",
      method: "post",
      url: "tblFinSrmApplyLetter/getPagelist",
      params: data,
    }),
  //获取申请主表详情
  getApplyInfo: (data) =>
    req3({
      baseUrl: "fin",
      method: "get",
      url: "tblFinSrmApplyInfo",
      params: data,
    }),
  //显示上一个月对账函列表
  getApplyLetterList: (data) =>
    req3({
      baseUrl: "srm",
      method: "get",
      url: "tblAccountbill/queryTblAccountbillDetail",
      params: data,
    }),
  //显示对账函列表
  getApplyLetterList2: (data) =>
    req3({
      baseUrl: "srm",
      method: "post",
      url: "tblAccountbill/queryTblAccountbill",
      params: data,
    }),
  //提交申请表
  submitApply: (data) =>
    req3({
      baseUrl: "fin",
      method: "put",
      url: "tblFinSrmApplyInfo/submitApply",
      params: data,
      timeout: 40000,
    }),
  //获取合同相关信息
  createToken: (data) =>
    req3({
      baseUrl: "fin",
      method: "get",
      url: "tblFinSrmSignContract/createToken",
      params: data,
    }),
  //插入申请关联对账函明细表记录
  saveBatchApplyLetter: (data) =>
    req3({
      baseUrl: "fin",
      method: "post",
      url: "tblFinSrmApplyLetter/saveBatchApplyLetter",
      params: data,
    }),
  //根据供应商主账号获取供应商详情
  queryMstSupplierInfo: (data) =>
    req3({
      baseUrl: "srm",
      method: "get",
      url: "mstSupplier/queryMstSupplierInfo",
      params: data,
    }),
  //供应商申请列表
  getPageListByCust: (data) =>
    req3({
      baseUrl: "fin",
      method: "post",
      url: "tblFinSrmApplyInfo/getPageListByCust",
      params: data,
    }),
  //获取主表关联的流程实例信息
  getApplyInstanceInf: (data) =>
    req3({
      baseUrl: "fin",
      method: "post",
      url: "tblFinSrmWfInstance/getOne",
      params: data,
    }),
  //供应商融资历史记录
  getHistoryPageList: (data) =>
    req3({
      baseUrl: "fin",
      method: "post",
      url: "tblFinSrmApplyInfo/getHistoryPagelist",
      params: data,
    }),
  //获取客服信息 -月有钱
  getCustomerServiceInfo: (data) =>
    req3({
      baseUrl: "fin",
      method: "post",
      url: "tblFinSrmApplyInfo/getCustomerServiceInfo",
      params: data,
    }),
  //融资确认申请 -月有钱
  // confirmApply: (data) => req3({
  //     baseUrl: 'fin',
  //     method: 'post',
  //     url: '/tblFinSrmApplyInfo/confirmApply',
  //     params: data
  // }),
  //获取申请主表详情信息
  getApplyInfoDetails: (data) =>
    req3({
      baseUrl: "fin",
      method: "post",
      url: "tblFinSrmApplyInfo/getOne",
      params: data,
    }),
  //获取申请流程状态
  getApplyActivity: (data) =>
    req3({
      baseUrl: "fin",
      method: "get",
      url: "tblFinSrmApplyInfo/getApplyActivity",
      params: data,
    }),
  //获取客户表详情,若没有则新增
  getOneOrSave: (data) =>
    req3({
      baseUrl: "fin",
      method: "post",
      url: "tblFinSrmCustomer/getOneOrSave",
      params: data,
    }),
  //获取供应商开户银行/银行账号
  getEsignAccountByCustId: (data) =>
    req3({
      baseUrl: "fin",
      method: "post",
      url: "tblFinSrmCustomer/getEsignAccountByCustId",
      params: data,
    }),
  //获取日期控件 可用/不可用日期数据
  getDays: (data) =>
    req3({
      baseUrl: "fin",
      method: "post",
      url: "tblFinSrmDays/getDays",
      params: data,
    }),
  //获取验证码
  getVerifyCode: (data) =>
    req3({
      baseUrl: "fin",
      method: "post",
      url: "tblFinSrmSignContract/sendCode",
      params: data,
    }),
  //一键签署
  oneKeySignContract: (data) =>
    req3({
      baseUrl: "fin",
      method: "post",
      url: "tblFinSrmSignContract/signContractList",
      params: data,
      timeout: 40000,
    }),
  //是否签署合同
  validatesSignedContract: (data) =>
    req3({
      baseUrl: "fin",
      method: "get",
      url: "tblFinSrmSignContract/validatesSignedContract",
      params: data,
    }),
  //金融流程图接口
  getAllActivityByApplyId: (data) =>
    req3({
      baseUrl: "fin",
      method: "get",
      url: "tblFinSrmWfActivity/getAllActivityByApplyId",
      params: data,
    }),
  //获取合同签署信息详情
  getSignCompany: (data) =>
    req3({
      baseUrl: "fin",
      method: "get",
      url: "tblFinSrmSignContract/getSignCompany",
      params: data,
    }),
  //通过方法
  approvedFinL: (data) =>
    req3({
      baseUrl: "fin",
      method: "put",
      url: "tblFinSrmApplyInfo/approvedFinL",
      params: data,
    }),
  // 工作流环节表更新共用接口
  commonUpdate: (data) =>
    req3({
      baseUrl: "fin",
      method: "post",
      url: "tblFinSrmWfActivity/commonUpdate",
      params: data,
    }),
  //供应商获取流程图接口
  getCustActivityByApplyId: (data) =>
    req3({
      baseUrl: "fin",
      method: "get",
      url: "tblFinSrmWfActivity/getCustActivityByApplyId",
      params: data,
    }),
  //获取申请退回原因等信息
  getRefusedActivity: (data) =>
    req3({
      baseUrl: "fin",
      method: "get",
      url: "tblFinSrmWfActivity/getRefusedActivity",
      params: data,
    }),
  //撤销申请
  revocationApply: (data) =>
    req3({
      baseUrl: "fin",
      method: "post",
      url: "tblFinSrmApplyInfo/returnApplyInfo",
      params: data,
    }),
  getLoanInfo: (data) =>
    req3({
      baseUrl: "fin",
      method: "get",
      url: "tblFinSrmWfActivity/getLoanInfo",
      params: data,
    }),
  //获取文件集合
  getFilePagelist: (data) =>
    req3({
      baseUrl: "fin",
      method: "post",
      url: "tblFinSrmAttachment/getPagelist",
      params: data,
    }),
  //查询附件列表
  queryAttachmentInfo: (data) =>
    req3({
      baseUrl: "fin",
      method: "post",
      url: "tblFinSrmAttachment/queryAttachmentInfo",
      params: data,
    }),
  //获取存在的未放款的申请信息
  getUnLoanApplyInfoMap: (data) =>
    req3({
      baseUrl: "fin",
      method: "get",
      url: "tblFinSrmApplyInfo/getUnLoanApplyInfoMap",
      params: data,
    }),
  // 获取文件下载地址
  getFileDownload: (data) =>
    req3({
      baseUrl: "fin",
      method: "get",
      url: "tblFinSrmAttachment",
      params: data,
      isOriginalGET: true,
      isBlob: true,
    }),
  // 查询订单融资可融额度
  getOrderFinAmount: (data) =>
    req3({
      baseUrl: "fin",
      method: "get",
      url: "tblFinSrmApplyInfo/getOrderFinAmount",
      params: data,
      isOriginalGET: true,
    }),
  // 获取订单历史融资额度
  getOrderFinHistory: (data) =>
    req3({
      baseUrl: "fin",
      method: "post",
      url: "tblFinSrmApplyInfo/getHistoryPagelist",
      params: data,
    }),
  // 查询交货融资可融额度
  getDeliveryFinAmount: (data) =>
    req3({
      baseUrl: "srm",
      method: "get",
      url: "tbl_instockbill/deliveryAvailableAmount",
      params: data,
      isOriginalGET: true,
    }),
  // 查询交货融资可选择订单列表
  getDeliveryOrderList: (data) =>
    req3({
      baseUrl: "srm",
      method: "post",
      url: "tbl_instockbill/financingOrderList",
      params: data,
    }),
  // 查看订单入库详情
  reviewOrderDetail: (data) =>
    req3({
      baseUrl: "srm",
      method: "post",
      url: "tbl_instockbill/orderInstockInfo",
      params: data,
    }),
  // 确认发起交货融资
  confirmApplyDeliveryFin: (data) =>
    req3({
      baseUrl: "fin",
      method: "post",
      url: "tblFinSrmOrderInstock/confirmDeliveryFinancing",
      params: data,
    }),
  //  交货融资申请提交
  submitApplyDeliveryFince: (data) =>
    req3({
      baseUrl: "fin",
      method: "post",
      url: "tblFinSrmOrderInstock/submitDeliveryFinancing",
      params: data,
    }),
  // 获取订单历史融资记录
  getOrderHostoryList: (data) =>
    req3({
      baseUrl: "fin",
      method: "post",
      url: "tblFinSrmOrderInstock/orderFinancingList",
      params: data,
    }),
  // 订单融资获取订单列表
  getAvaildOrderList: (data) =>
    req3({
      baseUrl: "srm",
      method: "post",
      url: "tblPurchaseorderbill/getOrders",
      params: data,
    }),
  // 查询订单详情
  reviewOrderChange: (data) =>
    req3({
      baseUrl: "fin",
      method: "post",
      url: "tblFinSrmApplyOrder/getOrderDetail",
      params: data,
    }),
  // 订单融确认申请
  confirmOrderFinance: (data) =>
    req3({
      baseUrl: "fin",
      method: "post",
      url: "tblFinSrmApplyInfo/confirmOrderApply",
      params: data,
    }),
  // 订单融提交融资申请
  submitOrderFinApply: (data) =>
    req3({
      baseUrl: "fin",
      method: "post",
      url: "tblFinSrmApplyInfo/submitOrderApply",
      params: data,
    }),
  //获取交货融已关联的订单
  getRelatedOrderList: (data) =>
    req3({
      baseUrl: "fin",
      method: "get",
      url: "tblFinSrmOrderInstock/orderInstocksByApplyId",
      params: data,
      isOriginalGET: true,
    }),
  //获取订单融资已关联的订单
  getOrderFinRelatedOrder: (data) =>
    req3({
      baseUrl: "fin",
      method: "get",
      url: "tblFinSrmApplyOrder/getApplyInfoDetail",
      params: data,
      isOriginalGET: true,
    }),
  //获取该供应商是否已维护担保人
  getIsGuarantor: (data) =>
    req3({
      baseUrl: "srm",
      method: "get",
      url: "srmMstGuarantor/isGuarantor",
      params: data,
      isOriginalGET: true,
    }),
  //订单融-获取订单在融资申请记录
  getOrderActAmountRecord: (data) =>
    req3({
      baseUrl: "fin",
      method: "get",
      url: "tblFinSrmApplyOrder/getActHistoryList",
      params: data,
      isOriginalGET: true,
    }),
  //获取交货融订单在融资申请记录
  getOrderFinAmountRecord: (data) =>
    req3({
      baseUrl: "fin",
      method: "get",
      url: "tblFinSrmApplyOrder/orderFinDistribution",
      params: data,
      isOriginalGET: true,
    }),
  //订单融 》获取所有已确认未交货订单
  getNoDeliveryOrders: (data) =>
    req3({
      baseUrl: "srm",
      method: "get",
      url: "tblPurchaseorderbill/getNoDeliveryOrders",
      params: data,
      isOriginalGET: true,
    }),
};
export default api;
